package com.tangruitao.dao;

import com.sun.tools.javap.TypeAnnotationWriter;
import com.tangruitao.bean.*;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

/**
 * 这个类的作者是13536
 * 开发日期:2021/12/30
 **/
public interface OrderDao {

  Users SelectUserByName(String name);

  List<Order> selectOrder(QueryOv ov);
//增加订单
 int insertOrder(Order order);
//确保编号的唯一性
 Detail selectDetailByNnm(String num);
// 增加明细
 int insertDetail(Detail detail);

 @Insert("insert into or_zh_de values(null,#{orderId},#{detailId})")
 int insetZh(@Param("orderId") int orderId,@Param("detailId") int detailId);

 //删除主表
 @Delete("delete from `order` where order_id=#{id}")
 int deleteOrder(int id);
 @Select("select * from or_zh_de where order_id=#{id}")
List<Zhong> selectZhByid(int id);
// 删除中间表
 @Delete("delete from or_zh_de where order_id=#{orderId}")
 int delectzh(int orderId);
// 删除明细表
 @Delete("delete from detail where detail_id=#{orderid}")
int deletDetail(int orderid);

 @Select("select * from node")
 List<Node> selectNote();
}
